package com.ymatou.shop.ui.activity.seller;

import android.content.Intent;
import android.os.Bundle;

import com.ymatou.shop.R;
import com.ymatou.shop.ui.activity.BaseTabActivity;

public class MainActivity extends BaseTabActivity {
	
	private final static String TAB_HOME = "home";
	private final static String TAB_MESSAGE = "message";
	private final static String TAB_ORDER = "order";
	private final static String TAB_NEW = "new";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_tab_bottom);

		setupViews();
	}
	
	@Override
	protected void setupViews() {
		super.setupViews();
		
//		addTab(TAB_HOME, getString(R.string.tab_home), 
//				new Intent(this, HomeActivity.class));
		addTab(TAB_MESSAGE, getString(R.string.tab_message), 
				new Intent(this, MessageActivity.class));
		addTab(TAB_ORDER, getString(R.string.tab_order_manage), 
				new Intent(this, OrderActivity.class));
		addTab(TAB_NEW, getString(R.string.tab_new_product), 
				new Intent(this, NewProductActivity.class));
	}
	
	@Override
	public void onTabChanged(String tabId) {
		int tabPos;
		if (TAB_HOME.equals(tabId)) {
			tabPos = 0;
		} else if (TAB_MESSAGE.equals(tabId)) {
			tabPos = 1;
		} else if (TAB_ORDER.equals(tabId)) {
			tabPos = 2;
		} else {
			tabPos = 3;
		}
		
		setCurrentTab(tabPos);
	}
}
